package handler

import (
	"compress/common"

	"compress/location"
	"log"
)






func GetConfig(mt int,msg M) {
	config := location.GetAllConfigFromFile()
	AddMsgQueue(mt,common.WsRes{
		Code:      common.SUCCESS,
		Data:      config,
		ErrorCode: 0,
		Action:    msg.Action,
		Msg : "ok",
	});
}

func UpdateConfig(mt int,msg M) {
	data := msg.Data
	key := common.Strval(data["key"])
	value := common.Strval(data["value"])
	if  location.UpdateConfig(key,value) {
		log.Println("更新配置",key,value,"成功")
	}
}


